'\" t
.TH "SYSTEMD\-STUB" "7" "" "systemd 257" "systemd-stub"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd-stub, sd-stub, linuxx64.efi.stub, linuxia32.efi.stub, linuxaa64.efi.stub \- A simple UEFI kernel boot stub
.SH "SYNOPSIS"
.PP
.RS 4
/usr/lib/systemd/boot/efi/linuxx64\&.efi\&.stub
.RE
.RS 4
/usr/lib/systemd/boot/efi/linuxia32\&.efi\&.stub
.RE
.RS 4
/usr/lib/systemd/boot/efi/linuxaa64\&.efi\&.stub
.RE
.RS 4
\fIESP\fR/\&.\&.\&./\fIfoo\fR\&.efi\&.extra\&.d/*\&.addon\&.efi
.RE
.RS 4
\fIESP\fR/\&.\&.\&./\fIfoo\fR\&.efi\&.extra\&.d/*\&.cred
.RE
.RS 4
\fIESP\fR/\&.\&.\&./\fIfoo\fR\&.efi\&.extra\&.d/*\&.raw
.RE
.RS 4
\fIESP\fR/\&.\&.\&./\fIfoo\fR\&.efi\&.extra\&.d/*\&.sysext\&.raw
.RE
.RS 4
\fIESP\fR/\&.\&.\&./\fIfoo\fR\&.efi\&.extra\&.d/*\&.confext\&.raw
.RE
.RS 4
\fIESP\fR/loader/addons/*\&.addon\&.efi
.RE
.RS 4
\fIESP\fR/loader/credentials/*\&.cred
.RE
.SH "DESCRIPTION"
.PP
\fBsystemd\-stub\fR
(stored in per\-architecture files
linuxx64\&.efi\&.stub,
linuxia32\&.efi\&.stub,
linuxaa64\&.efi\&.stub
on disk) is a simple UEFI boot stub\&. An UEFI boot stub is attached to a Linux kernel binary image, and is a piece of code that runs in the UEFI firmware environment before transitioning into the Linux kernel environment\&. The UEFI boot stub ensures a Linux kernel is executable as regular UEFI binary, and is able to do various preparations before switching the system into the Linux world\&.
.PP
The UEFI boot stub looks for various resources for the kernel invocation inside the UEFI PE binary itself\&. This allows combining various resources inside a single PE binary image (a "Unified Kernel Image" or "UKI" for short), which may then be signed via UEFI SecureBoot as a whole, covering all individual resources at once\&. Specifically it may include the following PE sections:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
A
"\&.linux"
section with the ELF Linux kernel image\&. This section is required\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.osrel"
section with OS release information, i\&.e\&. the contents of the
\fBos-release\fR(5)
file of the OS the kernel belongs to\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.cmdline"
section with the kernel command line to pass to the invoked kernel\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.initrd"
section with the initrd\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.ucode"
section with an initrd containing microcode, to be handed to the kernel before any other initrd\&. This initrd must not be compressed\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.splash"
section with an image (in the Windows
\&.BMP
format) to show on screen before invoking the kernel\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.dtb"
section with a compiled binary DeviceTree\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Zero or more
"\&.dtbauto"
sections\&.
systemd\-stub
will always use the first matching one\&. The match is performed by taking the first DeviceTree\*(Aqs
\fIcompatible\fR
string supplied by the firmware in configuration tables and comparing it with the first
\fIcompatible\fR
string from each of the
"\&.dtbauto"
sections\&. If the firmware does not provide a DeviceTree, the match is done using the
\fI\&.hwids\fR
section instead\&. After selecting a
"\&.hwids"
section (see the description below), the
\fIcompatible\fR
string from that section will be used to perform the same matching procedure\&. If a match is found, that
"\&.dtbauto"
section will be loaded and will override
\fI\&.dtb\fR
if present\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Zero or more
"\&.hwids"
sections with hardware IDs of the machines to match DeviceTrees\&.
systemd\-stub
will use the SMBIOS data to calculate hardware IDs of the machine (as per
\m[blue]\fBspecification\fR\m[]\&\s-2\u[1]\d\s+2), and then it will try to find any of them in each of the
"\&.hwids"
sections\&. The first matching section will be used\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.uname"
section with the kernel version information, i\&.e\&. the output of
\fBuname \-r\fR
for the kernel included in the
"\&.linux"
section\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.sbat"
section with
\m[blue]\fBSBAT\fR\m[]\&\s-2\u[2]\d\s+2
revocation metadata\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.pcrsig"
section with a set of cryptographic signatures for the expected TPM2 PCR values after the kernel has been booted, in JSON format\&. This is useful for implementing TPM2 policies that bind disk encryption and similar to kernels that are signed by a specific key\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
An optional
"\&.pcrpkey"
section with a public key in the PEM format matching the signature data in the
"\&.pcrsig"
section\&.
.RE
.PP
In a basic UKI, the sections listed above appear at most once, with the exception of
"\&.dtbauto"
and
"\&.hwids"
sections\&. In a multi\-profile UKI, multiple sets of these sections are present in a single file and form "profiles", one of which can be selected at boot\&. For this, the PE section
"\&.profile"
is defined to be used as the separator between sets of sections\&. The
"\&.profile"
section itself may contain meta\-information about the section, and follows a similar structure as the contents of the
"\&.osrel"
section\&. For further details about multi\-profile UKIs, see below\&.
.PP
If UEFI SecureBoot is enabled and the
"\&.cmdline"
section is present in the executed image, any attempts to override the kernel command line by passing one as invocation parameters to the EFI binary are ignored\&. Thus, in order to allow overriding the kernel command line, either disable UEFI SecureBoot, or don\*(Aqt include a kernel command line PE section in the kernel image file\&. If a command line is accepted via EFI invocation parameters to the EFI binary it is measured into TPM PCR 12 (if a TPM is present)\&.
.PP
If a DeviceTree is embedded in the
"\&.dtb"
section, it replaces an existing DeviceTree in the corresponding EFI configuration table\&. systemd\-stub will ask the firmware via the
"EFI_DT_FIXUP_PROTOCOL"
for hardware specific fixups to the DeviceTree\&.
.PP
The contents of 11 of these 12 sections are measured into TPM PCR 11\&. It is otherwise not used and thus the result can be pre\-calculated without too much effort\&. The
"\&.pcrsig"
section is not included in this PCR measurement, since it is supposed to contain signatures for the output of the measurement operation, and thus cannot also be input to it\&. If an UKI contains multiple profiles, only the PE sections of the selected profile (and those of the base profile, except if overridden) are measured\&.
.PP
If non\-zero, the selected numeric profile is measured into PCR 12\&.
.PP
When
"\&.pcrsig"
and/or
"\&.pcrpkey"
sections are present in a unified kernel image their contents are passed to the booted kernel in an synthetic initrd cpio archive that places them in the
/\&.extra/tpm2\-pcr\-signature\&.json
and
/\&.extra/tpm2\-pcr\-public\-key\&.pem
files\&. Typically, a
\fBtmpfiles.d\fR(5)
line then ensures they are copied into
/run/systemd/tpm2\-pcr\-signature\&.json
and
/run/systemd/tpm2\-pcr\-public\-key\&.pem
where they remain accessible even after the system transitions out of the initrd environment into the host file system\&. Tools such
\fBsystemd-cryptsetup@.service\fR(8),
\fBsystemd-cryptenroll\fR(1)
and
\fBsystemd-creds\fR(1)
will automatically use files present under these paths to unlock protected resources (encrypted storage or credentials) or bind encryption to booted kernels\&.
.PP
For further details about the UKI concept, see the
\m[blue]\fBUKI specification\fR\m[]\&\s-2\u[3]\d\s+2\&.
.SH "COMPANION FILES"
.PP
The
\fBsystemd\-stub\fR
UEFI boot stub automatically collects three types of auxiliary companion files optionally placed in drop\-in directories on the same partition as the EFI binary, dynamically generates
\fBcpio\fR
initrd archives from them, and passes them to the kernel\&. Specifically:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
For a kernel binary called
\fIfoo\fR\&.efi, it will look for files with the
\&.cred
suffix in a directory named
\fIfoo\fR\&.efi\&.extra\&.d/
next to it\&. If the kernel binary uses a counter for the purpose of
\m[blue]\fBAutomatic Boot Assessment\fR\m[]\&\s-2\u[4]\d\s+2, this counter will be ignored\&. For example,
\fIfoo\fR+3\-0\&.efi
will look in directory
\fIfoo\fR\&.efi\&.extra\&.d/\&. A
\fBcpio\fR
archive is generated from all files found that way, placing them in the
/\&.extra/credentials/
directory of the initrd file hierarchy\&. The main initrd may then access them in this directory\&. This is supposed to be used to store auxiliary, encrypted, authenticated credentials for use with
\fILoadCredentialEncrypted=\fR
in the UEFI System Partition\&. See
\fBsystemd.exec\fR(5)
and
\fBsystemd-creds\fR(1)
for details on encrypted credentials\&. The generated
\fBcpio\fR
archive is measured into TPM PCR 12 (if a TPM is present)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Similarly, files
\fIfoo\fR\&.efi\&.extra\&.d/*\&.sysext\&.raw
are packed up in a
\fBcpio\fR
archive and placed in the
/\&.extra/sysext/
directory in the initrd file hierarchy\&. This is supposed to be used to pass additional system extension images to the initrd\&. See
\fBsystemd-sysext\fR(8)
for details on system extension images\&. The generated
\fBcpio\fR
archive containing these system extension images is measured into TPM PCR 13 (if a TPM is present)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Similarly, files
\fIfoo\fR\&.efi\&.extra\&.d/*\&.confext\&.raw
are packed up in a
\fBcpio\fR
archive and placed in the
/\&.extra/confext/
directory in the initrd file hierarchy\&. This is supposed to be used to pass additional configuration extension images to the initrd\&. See
\fBsystemd-confext\fR(8)
for details on configuration extension images\&. The generated
\fBcpio\fR
archive containing these configuration extension images is measured into TPM PCR 12 (if a TPM is present)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Similarly, files
\fIfoo\fR\&.efi\&.extra\&.d/*\&.addon\&.efi
are loaded and verified as PE binaries and specific sections are loaded from them\&. Addons are used to pass additional kernel command line parameters ("\&.cmdline"
section), or DeviceTree blobs ("\&.dtb"
section), additional initrds ("\&.initrd"
section), and microcode updates ("\&.ucode"
section)\&. Addons allow those resources to be passed regardless of the kernel version being booted, for example allowing platform vendors to ship platform\-specific configuration\&.
.sp
In case Secure Boot is enabled, these files will be validated using keys in UEFI DB, Shim\*(Aqs DB or Shim\*(Aqs MOK, and only loaded if the check passes\&. Additionally, if both the addon and the UKI contain a
"\&.uname"
section, the addon will be rejected if they do not match exactly\&. It is recommended to always add a
"\&.sbat"
section to all signed addons, so that they may be revoked with a SBAT policy update, without requiring blocklisting via DBX/MOKX\&. The
\fBukify\fR(1)
tool will add a SBAT policy by default if none is passed when building addons\&. For more information on SBAT see
\m[blue]\fBShim documentation\fR\m[]\&\s-2\u[2]\d\s+2\&.
.sp
Addon files are sorted, loaded, and measured into TPM PCR 12 (if a TPM is present) and appended to the kernel command line\&. UKI command line options are listed first, then options from addons in
/loader/addons/*\&.addon\&.efi, and finally UKI\-specific addons\&. Device tree blobs are loaded and measured following the same algorithm\&. Microcode addons are passed to the kernel in inverse order (UKI specific addons, global addons, UKI embedded section)\&. This is because the microcode update driver stops on the first matching filename\&. Addons are always loaded in the same order based on the filename, so that, given the same set of addons, the same set of measurements can be expected in PCR12\&. However, note that the filename is not protected by the PE signature, and as such an attacker with write access to the ESP could potentially rename these files to change the order in which they are loaded, in a way that could alter the functionality of the kernel, as some options might be order\-dependent\&. If you sign such addons, you should pay attention to the PCR12 values and make use of an attestation service so that improper use of your signed addons can be detected and dealt with using one of the aforementioned revocation mechanisms\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Files
/loader/credentials/*\&.cred
are packed up in a
\fBcpio\fR
archive and placed in the
/\&.extra/global_credentials/
directory of the initrd file hierarchy\&. This is supposed to be used to pass additional credentials to the initrd, regardless of the kernel version being booted\&. The generated
\fBcpio\fR
archive is measured into TPM PCR 12 (if a TPM is present)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Additionally, files
/loader/addons/*\&.addon\&.efi
are loaded and verified as PE binaries, and
"\&.cmdline",
"\&.dtb",
"\&.initrd", and
"\&.ucode"
sections are parsed from them\&. This is supposed to be used to pass additional command line parameters, DeviceTree blobs, initrds, and microcode updates to the kernel, regardless of the kernel version being booted\&.
.RE
.PP
These mechanisms may be used to parameterize and extend trusted (i\&.e\&. signed), immutable initrd images in a reasonably safe way: all data they contain is measured into TPM PCRs\&. On access they should be further validated: in case of the credentials case by encrypting/authenticating them via TPM, as exposed by
\fBsystemd\-creds encrypt \-T\fR
(see
\fBsystemd-creds\fR(1)
for details); in case of the system extension images by using signed Verity images\&.
.SH "MULTI\-PROFILE UKIS"
.PP
In many contexts it is useful to allow invocation of a single UKI in multiple different modes (or "profiles") without compromising the cryptographic integrity, measurements and so on of the boot process\&. For example, a single UKI might provide three distinct profiles: a regular boot one, one that invokes a "factory reset" operation, and one that boots into a storage target mode (as in
\fBsystemd-storagetm.service\fR(8))\&. Each profile would then use the same
"\&.linux"
and
"\&.initrd"
sections, but would have a separate
"\&.cmdline"
section\&. For example the latter two profiles would extend the regular kernel command line with
"systemd\&.unit=factory\-reset\&.target"
or
"rd\&.systemd\&.unit=storagetm\&.target"\&.
.PP
A single UKI may support multiple profiles by means of the special
"\&.profile"
PE section\&. This section acts as separator between the PE sections of the individual profiles\&.
"\&.profile"
PE sections hence may appear multiple times in a single UKI, and the other PE sections listed above may appear multiple times too, if
"\&.profile"
are used, but only once before the first
"\&.profile"
section, once between each subsequent pair, and once after the last appearance of
"\&.profile"\&. The sections listed before the first
"\&.profile"
are considered the "base" profile of the UKI\&. Each
"\&.profile"
section then introduces a new profile, which are numbered starting from zero\&. The PE sections following each
"\&.profile"
are specific to that profile\&. When booting into a specific profile the base section\*(Aqs profiles are used in combination with the specific profile\*(Aqs sections: if the same section is defined in both, the per\-profile section overrides the base profile\*(Aqs version, otherwise the per\-profile sections is used together with the base profile sections\&.
.PP
A UKI that contains no
"\&.profile"
is consider equivalent to one that just contains a single
"\&.profile", as having only a single profile @0\&.
.PP
Here\*(Aqs a simple example for a multi\-profile UKI\*(Aqs sections, inspired by the setup suggested above:
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.B Table\ \&1.\ \&Multi\-Profile UKI Example
.TS
allbox tab(:);
lB lB.
T{
Section
T}:T{
Profile
T}
.T&
l l
l ^
l ^
l ^
l l
l l
l ^
l l
l ^.
T{
"\&.linux"
T}:T{
Base profile
T}
T{
"\&.osrel"
T}:
T{
"\&.cmdline"
T}:
T{
"\&.initrd"
T}:
T{
"\&.profile"
T}:T{
Profile @0
T}
T{
"\&.profile"
T}:T{
Profile @1
T}
T{
"\&.cmdline"
T}:
T{
"\&.profile"
T}:T{
Profile @2
T}
T{
"\&.cmdline"
T}:
.TE
.sp 1
.PP
The section list above would define three profiles\&. The first four sections make up the base profile\&. A
"\&.profile"
section then introduces profile @0\&. It doesn\*(Aqt override any sections (or add any) from the base section, hence it is immediately followed by another
"\&.profile"
section that then introduces section @1\&. This profile overrides the kernel command line\&. Finally, the last two sections define section @2, again overriding the command line\&. (Note that in this example the first
"\&.cmdline"
could also moved behind the first
"\&.profile"
with equivalent effect\&. To keep things nicely extensible, it\*(Aqs probably a good idea to keep the generic command line in the base section instead of profile 0, in case later added profiles might want to reuse it\&.)
.PP
The profile to boot may be controlled via the UKI\*(Aqs own command line: if the first argument starts with
"@", followed by a positive integer number in decimal, it selects the profile to boot into\&. If the first argument is not specified like that, the UKI will automatically boot into profile 0\&.
.PP
A
"\&.profile"
section may contain meta\-information about the profile\&. It follows a similar format as
"\&.osrel"
(i\&.e\&. an environment\-variable\-assignment\-block\-like list of newline separated strings)\&. Currently two fields are defined:
"ID="
is supposed to carry a short identifying string that identifies the profile (e\&.g\&.
"ID=factory\-reset")\&.
"TITLE="
should contain a human readable string that may appear in the boot menu entry for this profile (e\&.g\&.
"TITLE=\*(AqFactory Reset this Device\*(Aq")\&.
.SH "TPM PCR NOTES"
.PP
Note that when a unified kernel using
\fBsystemd\-stub\fR
is invoked the firmware will measure it as a whole to TPM PCR 4, covering all embedded resources, such as the stub code itself, the core kernel, the embedded initrd and kernel command line (see above for a full list), including all UKI profiles\&.
.PP
Also note that the Linux kernel will measure all initrds it receives into TPM PCR 9\&. This means every type of initrd (of the selected UKI profile) will possibly be measured two or three times: the initrds embedded in the kernel image will be measured to PCR 4, PCR 9 and PCR 11; the initrd synthesized from credentials (and the one synthesized from configuration extensions) will be measured to both PCR 9 and PCR 12; the initrd synthesized from system extensions will be measured to both PCR 4 and PCR 9\&. Let\*(Aqs summarize the OS resources and the PCRs they are measured to:
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.B Table\ \&2.\ \&OS Resource PCR Summary
.TS
allbox tab(:);
lB lB.
T{
OS Resource
T}:T{
Measurement PCR
T}
.T&
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l.
T{
\fBsystemd\-stub\fR code (the entry point of the unified PE binary)
T}:T{
4
T}
T{
Core kernel code (embedded in unified PE binary)
T}:T{
4 + 11
T}
T{
OS release information (embedded in the unified PE binary)
T}:T{
4 + 11
T}
T{
Main initrd (embedded in unified PE binary)
T}:T{
4 + 9 + 11
T}
T{
Microcode initrd (embedded in unified PE binary)
T}:T{
4 + 9 + 11
T}
T{
Default kernel command line (embedded in unified PE binary)
T}:T{
4 + 11
T}
T{
Overridden kernel command line
T}:T{
12
T}
T{
Boot splash (embedded in the unified PE binary)
T}:T{
4 + 11
T}
T{
TPM2 PCR signature JSON (embedded in unified PE binary, synthesized into initrd)
T}:T{
4 + 9
T}
T{
TPM2 PCR PEM public key (embedded in unified PE binary, synthesized into initrd)
T}:T{
4 + 9 + 11
T}
T{
Credentials (synthesized initrd from companion files)
T}:T{
9 + 12
T}
T{
System Extensions (synthesized initrd from companion files)
T}:T{
9 + 13
T}
T{
Configuration Extensions (synthesized initrd from companion files)
T}:T{
9 + 12
T}
T{
Selected profile unless zero
T}:T{
12
T}
.TE
.sp 1
.SH "EFI VARIABLES"
.PP
The following EFI variables are defined, set and read by
\fBsystemd\-stub\fR, under the vendor UUID
"4a67b082\-0a4c\-41cf\-b6c7\-440b29bb8c4f", for communication between the boot stub and the OS:
.PP
\fILoaderDevicePartUUID\fR
.RS 4
Contains the partition UUID of the partition the boot loader has been started from on the current boot (usually a EFI System Partition)\&. If already set by the boot loader, this will remain untouched by
\fBsystemd\-stub\fR\&. If not set yet, this will be set to the partition UUID of the partition the unified kernel is started from, in order to support systems that directly boot into a unified kernel image, bypassing any boot loader\&.
\fBsystemd-gpt-auto-generator\fR(8)
uses this information to automatically find the disk booted from, in order to discover various other partitions on the same disk automatically\&.
.sp
Added in version 224\&.
.RE
.PP
\fILoaderFirmwareInfo\fR, \fILoaderFirmwareType\fR
.RS 4
Brief firmware information\&. Use
\fBbootctl\fR(1)
to view this data\&.
.sp
Added in version 250\&.
.RE
.PP
\fILoaderImageIdentifier\fR
.RS 4
The file system path to the EFI executable of the boot loader for the current boot, relative to the partition\*(Aqs root directory (i\&.e\&. relative to the partition indicated by
\fILoaderDevicePartUUID\fR, see above)\&. If not set yet, this will be set to the file system path of the EFI executable of the booted unified kernel, in order to support systems that directly boot into a unified kernel image, bypassing any boot loader\&. Use
\fBbootctl\fR(1)
to view this data\&.
.sp
Added in version 237\&.
.RE
.PP
\fIStubDevicePartUUID\fR, \fIStubImageIdentifier\fR
.RS 4
Similar to
\fILoaderDevicePartUUID\fR
and
\fIStubImageIdentifier\fR, but indicates the location of the unified kernel image EFI binary rather than the location of the boot loader binary, regardless if booted via a boot loader or not\&.
.sp
Added in version 257\&.
.RE
.PP
\fIStubInfo\fR
.RS 4
Brief stub information\&. Use
\fBbootctl\fR(1)
to view this data\&.
.sp
Added in version 250\&.
.RE
.PP
\fIStubPcrKernelImage\fR
.RS 4
The PCR register index the kernel image, initrd image, boot splash, devicetree database, and the embedded command line are measured into, formatted as decimal ASCII string (e\&.g\&.
"11")\&. This variable is set if a measurement was successfully completed, and remains unset otherwise\&.
.sp
Added in version 252\&.
.RE
.PP
\fIStubPcrKernelParameters\fR
.RS 4
The PCR register index the kernel command line and credentials are measured into, formatted as decimal ASCII string (e\&.g\&.
"12")\&. This variable is set if a measurement was successfully completed, and remains unset otherwise\&.
.sp
Added in version 252\&.
.RE
.PP
\fIStubPcrInitRDSysExts\fR
.RS 4
The PCR register index the system extensions for the initrd, which are picked up from the file system the kernel image is located on\&. Formatted as decimal ASCII string (e\&.g\&.
"13")\&. This variable is set if a measurement was successfully completed, and remains unset otherwise\&.
.sp
Added in version 252\&.
.RE
.PP
\fIStubPcrInitRDConfExts\fR
.RS 4
The PCR register index the configuration extensions for the initrd, which are picked up from the file system the kernel image is located on\&. Formatted as decimal ASCII string (e\&.g\&.
"12")\&. This variable is set if a measurement was successfully completed, and remains unset otherwise\&.
.sp
Added in version 255\&.
.RE
.PP
\fIStubProfile\fR
.RS 4
The numeric index of the selected profile, without the
"@", formatted as decimal string\&. Set both on single\-profile and multi\-profile UKIs\&. (In the former case this variable will be set to
"0"
unconditionally\&.)
.sp
Added in version 257\&.
.RE
.PP
Note that some of the variables above may also be set by the boot loader\&. The stub will only set them if they aren\*(Aqt set already\&. Some of these variables are defined by the
\m[blue]\fBBoot Loader Interface\fR\m[]\&\s-2\u[5]\d\s+2\&.
.SH "INITRD RESOURCES"
.PP
The following resources are passed as initrd cpio archives to the booted kernel, and thus make up the initial file system hierarchy in the initrd execution environment:
.PP
/
.RS 4
The main initrd from the
"\&.initrd"
PE section of the unified kernel image\&.
.sp
Added in version 252\&.
.RE
.PP
/\&.extra/credentials/*\&.cred
.RS 4
Credential files (suffix
"\&.cred") that are placed next to the unified kernel image (as described above) are copied into the
/\&.extra/credentials/
directory in the initrd execution environment\&.
.sp
Added in version 252\&.
.RE
.PP
/\&.extra/global_credentials/*\&.cred
.RS 4
Similarly, credential files in the
/loader/credentials/
directory in the file system the unified kernel image is placed in are copied into the
/\&.extra/global_credentials/
directory in the initrd execution environment\&.
.sp
Added in version 252\&.
.RE
.PP
/\&.extra/sysext/*\&.sysext\&.raw
.RS 4
System extension image files (suffix
"\&.sysext\&.raw") that are placed next to the unified kernel image (as described above) are copied into the
/\&.extra/sysext/
directory in the initrd execution environment\&.
.sp
Added in version 252\&.
.RE
.PP
/\&.extra/confext/*\&.confext\&.raw
.RS 4
Configuration extension image files (suffix
"\&.confext\&.raw") that are placed next to the unified kernel image (as described above) are copied into the
/\&.extra/confext/
directory in the initrd execution environment\&.
.sp
Added in version 255\&.
.RE
.PP
/\&.extra/tpm2\-pcr\-signature\&.json
.RS 4
The TPM2 PCR signature JSON object included in the
"\&.pcrsig"
PE section of the unified kernel image is copied into the
/\&.extra/tpm2\-pcr\-signature\&.json
file in the initrd execution environment\&.
.sp
Added in version 252\&.
.RE
.PP
/\&.extra/tpm2\-pcr\-public\-key\&.pem
.RS 4
The PEM public key included in the
"\&.pcrpkey"
PE section of the unified kernel image is copied into the
/\&.extra/tpm2\-pcr\-public\-key\&.pem
file in the initrd execution environment\&.
.sp
Added in version 252\&.
.RE
.PP
/\&.extra/profile, /\&.extra/os\-release
.RS 4
The contents of the
"\&.profile"
and
"\&.osrel"
sections of the selected profile, if any\&.
.sp
Added in version 257\&.
.RE
.PP
Note that all these files are located in the
"tmpfs"
file system the kernel sets up for the initrd file hierarchy and are thus lost when the system transitions from the initrd execution environment into the host file system\&. If these resources shall be kept around over this transition they need to be copied to a place that survives the transition first, for example via a suitable
\fBtmpfiles.d\fR(5)
line\&. By default, this is done for the TPM2 PCR signature and public key files\&.
.SH "SMBIOS TYPE 11 STRINGS"
.PP
\fBsystemd\-stub\fR
can be configured using SMBIOS Type 11 strings\&. Applicable strings consist of a name, followed by
"=", followed by the value\&. Unless
\fBsystemd\-stub\fR
detects it is running inside a confidential computing environment,
\fBsystemd\-stub\fR
will search the table for a string with a specific name, and if found, use its value\&. The following strings are read:
.PP
\fIio\&.systemd\&.stub\&.kernel\-cmdline\-extra\fR
.RS 4
If set, the value of this string is added to the list of kernel command line arguments that are measured in PCR12 and passed to the kernel\&.
.sp
Added in version 254\&.
.RE
.SH "ASSEMBLING KERNEL IMAGES"
.PP
In order to assemble a bootable Unified Kernel Image from various components as described above, use
\fBukify\fR(1)\&.
.SH "SEE ALSO"
.PP
\fBsystemd-boot\fR(7), \fBsystemd.exec\fR(5), \fBsystemd-creds\fR(1), \fBsystemd-sysext\fR(8), \m[blue]\fBBoot Loader Specification\fR\m[]\&\s-2\u[6]\d\s+2, \m[blue]\fBBoot Loader Interface\fR\m[]\&\s-2\u[5]\d\s+2, \fBukify\fR(1), \fBsystemd-measure\fR(1), \m[blue]\fBTPM2 PCR Measurements Made by systemd\fR\m[]\&\s-2\u[7]\d\s+2
.SH "NOTES"
.IP " 1." 4
specification
.RS 4
\%https://learn.microsoft.com/en-us/windows-hardware/drivers/install/specifying-hardware-ids-for-a-computer
.RE
.IP " 2." 4
SBAT
.RS 4
\%https://github.com/rhboot/shim/blob/main/SBAT.md
.RE
.IP " 3." 4
UKI specification
.RS 4
\%https://uapi-group.org/specifications/specs/unified_kernel_image/
.RE
.IP " 4." 4
Automatic Boot Assessment
.RS 4
\%https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT
.RE
.IP " 5." 4
Boot Loader Interface
.RS 4
\%https://systemd.io/BOOT_LOADER_INTERFACE
.RE
.IP " 6." 4
Boot Loader Specification
.RS 4
\%https://uapi-group.org/specifications/specs/boot_loader_specification
.RE
.IP " 7." 4
TPM2 PCR Measurements Made by systemd
.RS 4
\%https://systemd.io/TPM2_PCR_MEASUREMENTS
.RE
